package cn.istartfinancial.util;


import cn.istartfinancial.entity.base.CurrentUser;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;

/**
 * @author: Nzp
 * @date: 2018/8/31 9:35
 * @description: 管理工具类
 */
public class CommonUtil
{
    /**
     * 获取当前用户
     */
    public static CurrentUser getUser()
    {
        org.apache.shiro.subject.Subject subject = SecurityUtils.getSubject();
        Session session = subject.getSession();
        return (CurrentUser) session.getAttribute("curentUser");
    }
}
